package com.zhuss.controller.advice.complaint;

import com.zhuss.advice.complaint.ComplaintReadServiceWeChat;
import com.zhuss.bean.bo.advice.Complaint.weChat.DetailComplaintWeChatBo;
import com.zhuss.bean.bo.advice.Complaint.weChat.SearchComplaintWeChatBo;
import com.zhuss.common.BaseController;
import com.zhuss.exception.WpsException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: zhushanshuo
 * @Date: 2020/4/14 8:17
 */
@RestController
@RequestMapping("/complaint")
public class ComplaintReadController extends BaseController {

    @Autowired
    @Qualifier("complaintReadServiceWeChat")
    private ComplaintReadServiceWeChat complaintReadServiceWeChat;

    /**
     * 微信个人列表
     * @throws WpsException
     */
    @ResponseBody
    @PostMapping("/weChatList")
    @Transactional(rollbackFor = Exception.class)
    public Object weChatList(@RequestBody SearchComplaintWeChatBo bo) throws WpsException {
        Object result = complaintReadServiceWeChat.weChatList(bo);
        return result;
    }

    /**
     * 微信详情
     * @throws WpsException
     */
    @ResponseBody
    @PostMapping("/weChatDetail")
    @Transactional(rollbackFor = Exception.class)
    public Object weChatDetail(@RequestBody DetailComplaintWeChatBo bo) throws WpsException {
        Object result = complaintReadServiceWeChat.weChatDetail(bo);
        return result;
    }
}
